From: Florian Müllner Date: Sun, 28 Jun 2020 22:16:58 +0000 (+0200) Subject: st/viewport: Only extend child allocation when scrolled X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~199 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=481014ac9edf0e79601140727c2be817b1f72c12;p=gnome-shell.git st/viewport: Only extend child allocation when scrolled When scrolled, the container's allocation is smaller than the allocation of the content. To account for that, commit 2717ca9d080eb added the additional size reported by the layout manager to the content allocation. However as it did so unconditionally, we now allow children to extend outside the parent even when *not* scrolled, which breaks any constraints set on the container (like "width" or "max-height"). Fix this by only extending the child allocation in scrollable dimensions. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2491 --- diff --git a/src/st/st-viewport.c b/src/st/st-viewport.c index fb1df91d9..039eebf46 100644 --- a/src/st/st-viewport.c +++ b/src/st/st-viewport.c @@ -261,8 +261,10 @@ st_viewport_allocate (ClutterActor *actor, clutter_actor_set_allocation (actor, box); content_box = viewport_box; - content_box.x2 += MAX (0, min_width - avail_width); - content_box.y2 += MAX (0, min_height - avail_height); + if (priv->hadjustment) + content_box.x2 += MAX (0, min_width - avail_width); + if (priv->vadjustment) + content_box.y2 += MAX (0, min_height - avail_height); clutter_layout_manager_allocate (layout, CLUTTER_CONTAINER (actor), &content_box);